﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="UserPWDModify.aspx.cs"
    Inherits="WorkOrder.UserPWDModify" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="./css/left.css" type="text/css" rel="STYLESHEET" />
    <link href="./css/site2.css" type="text/css" rel="STYLESHEET" />
    <script language="javascript" type="text/javascript">        //加在head中，PNG无灰色背景
        var tmp = window.navigator.userAgent.toLowerCase().indexOf("MSIE");
        //加在head中，PNG无灰色背景
        function correctPNG() {
            for (var i = 0; i < document.images.length; i++) {
                var img = document.images[i];
                var imgName = img.src.toUpperCase();
                if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                    var imgID = (img.id) ? "id='" + img.id + "' " : "";
                    var imgClass = (img.className) ? "class='" + img.className + "' " : "";
                    var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
                    var imgStyle = "display:inline-block;" + img.style.cssText;
                    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
                    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
                    if (tmp >= 1) {
                        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    else {
                        if (img.parentNode.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
       + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
                    img.outerHTML = strNewHTML;

                }
            }
        }

        if (window.addEventListener) {
            window.addEventListener('DOMContentLoaded', correctPNG, false);   //firefox
            window.addEventListener('load', correctPNG, false);
        } else if (window.attachEvent) {
            window.attachEvent('onload', correctPNG);  //IE
        }
    </script>
    <script type="text/javascript">
        function saveValidate() {
            var a = document.getElementById("txtUserName");
            var b = document.getElementById("txtUserPWDs");
            var c = document.getElementById("txtUserPWD");
            var d = document.getElementById("txtUserPWD2");
            if (a.value == "")
                alert("请输入登录名！");
            else if (/[^0-9a-zA-Z_]/g.test(a.value))
                alert("输入的登录名只能为数字、下划线和英文字符！")
            else if (b.value == "")
                alert("请输入密码！")
            else if (/[^0-9a-zA-Z_]/g.test(b.value))
                alert("输入的密码只能为数字、下划线和英文字符！")
            //            else if (b.value.search(/\s/)!=-1)
            //                alert("输入的密码中不允许有空格！")
            else if (c.value == "")
                alert("请输入新密码！")
            else if (/[^0-9a-zA-Z_]/g.test(c.value))
                alert("输入的新密码只能为数字、下划线和英文字符！")
            else if (d.value == "")
                alert("请输入确认密码！")
            else if (/[^0-9a-zA-Z_]/g.test(d.value))
                alert("输入的确认密码只能为数字、下划线和英文字符！")
            else if (c.value != d.value)
                alert("两次输入的密码不一致，请检查！")
            else {
                return true;
            }
            return false;
        }
        
    </script>
    <style type="text/css">
        .style1
        {
            width: 300px;
        }
        .style2
        {
            height: 24px;
            width: 300px;
        }
    </style>
</head>
<body style="margin: 0 0 0 0; background-color: #fff; border-left: solid 1px #54a6e2;">
    <form id="form1" runat="server">
    <div>
        <table width="100%;" style="border: none 0;">
            <tr>
                <td style="height: 2px;">
                </td>
            </tr>
            <tr>
                <td style="border: solid 1px #9fd6ff; background-image: url('images/snap3.jpg');
                    height: 24px; color: #0930a5;">
                    &nbsp;&nbsp;<img align="absmiddle" src="images/doc3.gif" />&nbsp;&nbsp;当前位置：修改用户登录密码
                </td>
            </tr>
            <tr>
                <td style="height: 1px;">
                </td>
            </tr>
        </table>
        <table width="100%" border="0">
            <tr>
                <td>
                    <div style="border: solid 1px #9fd6ff; background-color: #d4f1f9; border-bottom: none;">
                        <table style="width: 100%">
                            <tr>
                                <td style="height: 20px;">
                                    &nbsp;&nbsp;<img alt="" align="absmiddle" src="./images/181.gif" />&nbsp; <strong>修改密码</strong>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div style="border: solid 1px #9fd6ff; background-color: #f0f8ff">
                        <table>
                            <tr>
                                <td style="width: 10px;">
                                </td>
                                <td>
                                    <table border="0" style="width: 100%">
                                        <tr>
                                            <td style="width: 65px">
                                            </td>
                                            <td class="style1">
                                            </td>
                                            <td style="width: 21px">
                                            </td>
                                            <td style="width: 65px">
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px">
                                                登录名：
                                            </td>
                                            <td class="style1">
                                                <input id="txtUserName" runat="server" type="text" class="TextBox" style="width: 165px" />
                                            </td>
                                            <td style="width: 21px">
                                            </td>
                                            <td style="width: 65px">
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px; height: 24px;">
                                                旧密码：
                                            </td>
                                            <td class="style2">
                                                <input id="txtUserPWDs" runat="server" type="password" class="TextBox" style="width: 165px" />
                                            </td>
                                            <td style="width: 21px; height: 24px;">
                                            </td>
                                            <td style="width: 65px; height: 24px;">
                                            </td>
                                            <td style="height: 24px">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px">
                                                新密码：
                                            </td>
                                            <td class="style1">
                                                <input id="txtUserPWD" runat="server" type="password" class="TextBox" style="width: 165px" />
                                            </td>
                                            <td style="width: 21px">
                                            </td>
                                            <td style="width: 65px">
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px">
                                                确认密码：
                                            </td>
                                            <td class="style1">
                                                <input id="txtUserPWD2" runat="server" type="password" class="TextBox" style="width: 165px" />
                                            </td>
                                            <td style="width: 21px">
                                            </td>
                                            <td style="width: 65px">
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px">
                                                &nbsp;
                                            </td>
                                            <td class="style1">
                                                【注意：密码字符只能为字母、数字或下划线】
                                            </td>
                                            <td style="width: 21px">
                                                &nbsp;
                                            </td>
                                            <td style="width: 65px">
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px; height: 24px;">
                                            </td>
                                            <td colspan="4" style="height: 24px">
                                                <asp:Button ID="btnSearch" runat="server" class="Button" OnClientClick="return saveValidate();"
                                                    Text="修  改" OnClick="btnSearch_Click" />
                                                &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;<asp:Button ID="Button2" runat="server" Text="取  消"
                                                    class="Button" />&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
                                                <asp:Label ID="lblMsg" runat="server" ForeColor="DarkGreen"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px;">
                                            </td>
                                            <td class="style1">
                                            </td>
                                            <td style="width: 21px;">
                                            </td>
                                            <td style="width: 65px;">
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 65px;">
                                                &nbsp;
                                            </td>
                                            <td class="style1">
                                                &nbsp;
                                            </td>
                                            <td style="width: 21px;">
                                                &nbsp;
                                            </td>
                                            <td style="width: 65px;">
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="height: 2px;">
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
